package component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import db.JdbcOperate;

public class Select {
	private JdbcOperate operator = new JdbcOperate();
	private String id;
	private String name;
	private String reg;
	private String tip;
	private List<String> options;

	public Select(String id, String name, String reg, String tip,
			List<String> options) {
		this.id = id;
		this.name = name;
		this.reg = reg;
		this.tip = tip;
		this.options = options;
	}


	@Override
	public String toString() {
		Map<String, String> attries = new HashMap<String, String>();
		StringBuffer sb=new StringBuffer();
		attries.put("id", id);
		attries.put("name", id);
		Tag select = new Tag("select");
		select.setAttribute(attries);
		if (null != options) {
			for (String option : this.options) {
				sb.append(option.toString());
			}
			select.setText(sb.toString());
		}
		return select.toString();
	}


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	public List<String> getOptions() {
		return options;
	}


	public void setOptions(List<String> options) {
		this.options = options;
	}


	public String getReg() {
		return reg;
	}

	public void setReg(String reg) {
		this.reg = reg;
	}

	public String getTip() {
		return tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}

	public Select() {
	}
}
